// 资源错误类型定义
export enum ResourceErrorType {
  UPLOAD_FAILED = 'UPLOAD_FAILED',
  INVALID_FILE = 'INVALID_FILE',
  NETWORK_ERROR = 'NETWORK_ERROR',
  SERVER_ERROR = 'SERVER_ERROR',
  UNKNOWN_ERROR = 'UNKNOWN_ERROR',
  VALIDATION_ERROR = 'VALIDATION_ERROR'
}

// 资源错误接口
export interface ResourceError {
  type: ResourceErrorType;
  message: string;
}

// 资源元数据接口
export interface ResourceMetadata {
  title: string;
  description: string;
  type: string;
  size: number;
  uploaderId: string;
  uploaderName: string;
}

// 资源接口
export interface Resource extends ResourceMetadata {
  id: string;
  createdAt: string;
  updatedAt: string;
  size: number;
  downloadCount: number;
  coverUrl: string;
  coverImageUrl?: string; // 后端返回的封面图URL
  torrentId: string;
  downloadUrl?: string;
  isPay?: boolean; // 用户是否已购买该资源
  points?: number; // 资源所需积分
  tags?: string[]; // 资源标签
}